#ifndef _SYS_METHOD_H_
#define _SYS_METHOD_H_

#include "Slot.h"
#include "SysTypes.h"

#define METHOD_VTABLE(self)   ((MethodVTable*)((FanObj*)self)->vtable)


extern Type*    Method_classType;
extern VTable*  Method_classVTable;


/* [sys::Method] Attributes */
struct Method
{
  Slot          super;
};


/* [sys::Method] Virtual-table */
typedef struct MethodVTable
{
  SlotVTable    super;
} MethodVTable;


/* [sys::Method] Methods and fields */
Type*           Method_returns(Method* self);
List*           Method_params(Method* self);
Func*           Method_func(Method* self);
NullableObj     Method_callList(Method* self, List* args);
NullableObj     Method_callOn(Method* self, NullableObj target, List* args);
NullableObj     Method_call_0(Method* self);
NullableObj     Method_call_1(Method* self, NullableObj a);
NullableObj     Method_call_2(Method* self, NullableObj a, NullableObj b);
NullableObj     Method_call_3(Method* self, NullableObj a, NullableObj b, NullableObj c);
NullableObj     Method_call_4(Method* self, NullableObj a, NullableObj b, NullableObj c, NullableObj d);
NullableObj     Method_call_5(Method* self, NullableObj a, NullableObj b, NullableObj c, NullableObj d, NullableObj e);
NullableObj     Method_call_6(Method* self, NullableObj a, NullableObj b, NullableObj c, NullableObj d, NullableObj e, NullableObj f);
NullableObj     Method_call_7(Method* self, NullableObj a, NullableObj b, NullableObj c, NullableObj d, NullableObj e, NullableObj f, NullableObj g);
NullableObj     Method_call(Method* self, NullableObj a, NullableObj b, NullableObj c, NullableObj d, NullableObj e, NullableObj f, NullableObj g, NullableObj h);


/* [sys::Method] Type-system functions */
Type*           Method_initType(void);
VTable*         Method_initVTable(void);
void            Method_initStatic(void);


#endif
